import yagmail,logging,HTMLTestRunner_cn

class Tools():
    def send_mail(self):
        mail = yagmail.SMTP(user='3047217905@qq.com',password='wsmqyonwzaxqdcgj',host='smtp.qq.com',port='465')
        mail.send(to=' 1056596697@qq.com',subject='19-刘婷婷-A3mall前后端交互',contents=['A3mall1_qian_hou.py','A3mall2_qian_hou.py'])
        mail.close()

    def report(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(open('./A3mall_qian_hou.html','wb'),
                                                  title='A3mall前端后端自动化测试',
                                                  description='包含前端购买商品并退款，后端同意退款，断言退款后的金额是否和前端保持一致')
        return report

    def Log(self):
        log = logging.basicConfig(level=logging.DEBUG,filename='./A3mall.log',filemode='a+',
                                  format='%(levelname)s %(asctime)s %(filename)s %(message)s %(lineno)d')
        return log